UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'NYKU7fmbj+tfm4/BWeG4pteOlBNqo4Rd0S1KwEBUq7A=' 
WHERE 
  key_id = '6c78ddf300ab57024411942dc1716934808e982001e80dd2b2a95c2c629d58d5' 
  AND (
    token = 'NYKU7fmbj+tfm4/BWeG4pteOlBNqo4Rd0S1KwEBUq7A=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00028