UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'ETU/HeGasBuf9xtzlNqJ+/BMjNBmHddzIdunc2IrHlQ=' 
WHERE 
  key_id = 'e7b85e4067468544fdb18006b2ee612ffbb3461f0a5d26f76b2fda410ea2b405' 
  AND (
    token = 'ETU/HeGasBuf9xtzlNqJ+/BMjNBmHddzIdunc2IrHlQ=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00024