UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'ynW/IdRTYOzTT1Y33+TOcS0dzXIZjC9jLKnCjZoMrm4=' 
WHERE 
  key_id = '2657a99a7578bf57fb9f534d94c80da36a04e4992022e26d7a27e5715e5c59bc' 
  AND (
    token = 'ynW/IdRTYOzTT1Y33+TOcS0dzXIZjC9jLKnCjZoMrm4=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00029