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

Query time 0.00024