UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '1SayWb7ExT9C5MyUOkzHJS/JtqfS+ZLCBXuvEjNZgRg=' 
WHERE 
  key_id = '61c41cab8a92e0930779778911c353128dadac555e60e6dec15528b3f613e885' 
  AND (
    token = '1SayWb7ExT9C5MyUOkzHJS/JtqfS+ZLCBXuvEjNZgRg=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00037