UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'wIlfHZGDAPHGSCxY7xJpudbyCJFetEGShErtxmv8Omk=' 
WHERE 
  key_id = '91dc99a7ec30b2df97af56aa0da28e9181b2ad8517f7adeed664e38e5dd80ac5' 
  AND (
    token = 'wIlfHZGDAPHGSCxY7xJpudbyCJFetEGShErtxmv8Omk=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00040