UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'KWfZ0V2/lP5kfdc3q2n3P6S84bHyAEOWV4B9mU9XEtI=' 
WHERE 
  key_id = '29806b22fce371c3987e1d76b7d81376e48b46602bcf293a3f66fe5ef5819c86' 
  AND (
    token = 'KWfZ0V2/lP5kfdc3q2n3P6S84bHyAEOWV4B9mU9XEtI=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00025