UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'VYzEr6X/pCjV+CRnmyU15hEwQ0fZ2rgZ1s/3MFTruVU=' 
WHERE 
  key_id = '56a16c15cd24615c7174167a6075af477de8481daa50380a42e6a689f91649fc' 
  AND (
    token = 'VYzEr6X/pCjV+CRnmyU15hEwQ0fZ2rgZ1s/3MFTruVU=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00027