UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '7yTOckXPpQjYoeMhxBlnK9JLc4vBCz7fWgu4GP6XMwo=' 
WHERE 
  key_id = '2f444115ff9564a911077b9c6801403c6b4c0ab317815714f7390f46eb332169' 
  AND (
    token = '7yTOckXPpQjYoeMhxBlnK9JLc4vBCz7fWgu4GP6XMwo=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00031