UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'vNugormU0w0TX9TiYxILLLaBG25QaRalnbOIfRml4jg=' 
WHERE 
  key_id = '552a0401cf5576b24dad28bf7d196510c5bb63e93259a79f60cb0beded7ede52' 
  AND (
    token = 'vNugormU0w0TX9TiYxILLLaBG25QaRalnbOIfRml4jg=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00033