UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '4LXDYstNA6MfPfMzt3JOVT7P3HFolE4ABmALgkc3vm0=' 
WHERE 
  key_id = 'e370d59fe5b130a14c4e9e188814bb4bac29a3879187c3cf2a08a9796e812583' 
  AND (
    token = '4LXDYstNA6MfPfMzt3JOVT7P3HFolE4ABmALgkc3vm0=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00016