UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '86hMgbbQewy+MC09wjsfstK6N72Pvm4JzbRwoE7HRM0=' 
WHERE 
  key_id = '7df6b959c535bcbb35024123e32aec153f2680e820cb8e0f8cf43d2c58f8e131' 
  AND (
    token = '86hMgbbQewy+MC09wjsfstK6N72Pvm4JzbRwoE7HRM0=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00028