UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'v95VLCGQkZoTYBucmvOzc0gWCTW9WwjipxNQ/7LJv+0=' 
WHERE 
  key_id = 'e6952fb525becde61ddbc3e004034647fd5bac06ab0b46ad07dcaee5f7098d54' 
  AND (
    token = 'v95VLCGQkZoTYBucmvOzc0gWCTW9WwjipxNQ/7LJv+0=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00044