UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'US22Vd4ZiaDLe/ikLXLW+mp0pYtntLgjyI3q61Pb7xQ=' 
WHERE 
  key_id = 'e079f0f2cad8808d2ff41d07a533e505f7a5f738bee4928a122d2446dad30641' 
  AND (
    token = 'US22Vd4ZiaDLe/ikLXLW+mp0pYtntLgjyI3q61Pb7xQ=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00032