UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'yHB8sS3VozrdTkyhG0ZVA8NydLHYLXuFd/3Orgc8mkU=' 
WHERE 
  key_id = '2f1fc94dfc6a004d751598915705f52af7d4e19b8420012b31da9014fb6571f0' 
  AND (
    token = 'yHB8sS3VozrdTkyhG0ZVA8NydLHYLXuFd/3Orgc8mkU=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00028