UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'UnTV2ZamGD5Bw17JJaoE5Sci/WaX9E2qWoEIeCG9EhA=' 
WHERE 
  key_id = 'a494c6b8299af43158561f9d2b102b7a2fa3c7cb4f0bd53b93875d55241c7aa8' 
  AND (
    token = 'UnTV2ZamGD5Bw17JJaoE5Sci/WaX9E2qWoEIeCG9EhA=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00045