UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'oFyjjRwJouNXADVzTSCS5bqJpvXMucPt5KmLAbykybM=' 
WHERE 
  key_id = 'b79a34a5f2bf7ec751a1e481462dccfbd6fda6a1c494a9aeeb338d8c935f4637' 
  AND (
    token = 'oFyjjRwJouNXADVzTSCS5bqJpvXMucPt5KmLAbykybM=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00023