UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'LFSJe4xT/BvpcS2bF3YpOpLFMWwtN0wRa8hl59cyrqs=' 
WHERE 
  key_id = '18ab84563b296045b98597c67c7b41f4d3ec091673dbe2d7b2c7285aa53a854c' 
  AND (
    token = 'LFSJe4xT/BvpcS2bF3YpOpLFMWwtN0wRa8hl59cyrqs=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00031