UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'PhpYUfjZ7Jq3tDiMGCAl4esT1aiCu1Ng9QRXE8Yi9KQ=' 
WHERE 
  key_id = '90f52616092f2285284126b24595689b24502d9fd60d58ca2bdea527310abd27' 
  AND (
    token = 'PhpYUfjZ7Jq3tDiMGCAl4esT1aiCu1Ng9QRXE8Yi9KQ=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00033