UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '0S9HAVCIf0okOJjPf9AJ3zzuhfZBlO58hJMqzdtrJlY=' 
WHERE 
  key_id = '205042f31ee252531ca6c84b377bad3fc3277a3557b1d32fbf1baad409554eb1' 
  AND (
    token = '0S9HAVCIf0okOJjPf9AJ3zzuhfZBlO58hJMqzdtrJlY=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00027