UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'nDXT2xbUnERexeDs0wa60KZ7gb9vMpcDJ3lLDjYRt5s=' 
WHERE 
  key_id = '8bf6b62c8835477270e10d5b508582e26c64dd0429278b514d14fcd69e374e8f' 
  AND (
    token = 'nDXT2xbUnERexeDs0wa60KZ7gb9vMpcDJ3lLDjYRt5s=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00015