UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'kqMfo/nZyu3IzA8CXeiQJ66nU9fHhtGdvdCLjLYwCuE=' 
WHERE 
  key_id = 'd0e3a17575927aeac9aa6a7349cf1c239354d2d4659ac9a44005b5375208d68c' 
  AND (
    token = 'kqMfo/nZyu3IzA8CXeiQJ66nU9fHhtGdvdCLjLYwCuE=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00050