UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'eu6Kzmdru1Vgkwz2yw1JWQi1sTnGoGjRcz55oYavrlY=' 
WHERE 
  key_id = 'a64ae2da0037c0ff468071d10f7e4db85fa36ca5a199bb61d23ada5e29e2edf5' 
  AND (
    token = 'eu6Kzmdru1Vgkwz2yw1JWQi1sTnGoGjRcz55oYavrlY=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00044