UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'hq86QjQPW79MgyUCrhX5vAuqnvyucKrMikaXvEe2c14=' 
WHERE 
  key_id = '4de9bb1dff00959c5a42460fb33cf5245c8ac95811418ccdb7cc964b9aad636c' 
  AND (
    token = 'hq86QjQPW79MgyUCrhX5vAuqnvyucKrMikaXvEe2c14=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00028