UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'NOP5R6MWbeib289vg0RXAiyna1U3Tnl7Zx6GvREU0uM=' 
WHERE 
  key_id = '5fbb533bc33bcc5ac2c56f3a591791f3de357ce784a8fcdd8aa32974cba046ac' 
  AND (
    token = 'NOP5R6MWbeib289vg0RXAiyna1U3Tnl7Zx6GvREU0uM=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00039