UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'qnDqGw/8d9PgmbXYJ9hoZNXnyeYoxsLLacvf/NF88xE=' 
WHERE 
  key_id = 'f93abcc8f3da46f7a65518911c892e3d772b09bdc90ed9032a0d79dc1f795cee' 
  AND (
    token = 'qnDqGw/8d9PgmbXYJ9hoZNXnyeYoxsLLacvf/NF88xE=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00039