UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'effnsMnf2OqDAhhZ3WQcopBh6kevoIX3fjKJgWX239A=' 
WHERE 
  key_id = '84b93ef8b876300afff0ae677c9974a74f60db0ac43f373b0e45e80f17a329c1' 
  AND (
    token = 'effnsMnf2OqDAhhZ3WQcopBh6kevoIX3fjKJgWX239A=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00042